//
//  DateCell.swift
//  ImGuider X
//
//  Created by 王鹏宇 on 9/27/18.
//  Copyright © 2018 imguider. All rights reserved.
//

import UIKit

class DateCell: UICollectionViewCell {

    @IBOutlet weak var selectView: UIView!
    @IBOutlet weak var selectDateLabel: UILabel!
    
    @IBOutlet weak var normalView: UIView!
    @IBOutlet weak var normalDateLabel: UILabel!
    
//    var isSelect : Bool = false {
//        didSet{
//
//            if isSelect {
//                self.normalView.isHidden = true
//                self.selectView.isHidden = false
//            }else {
//                self.normalView.isHidden = false
//                self.selectView.isHidden = true
//            }
//        }
//    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        
        self.normalView.backgroundColor = UIColor.hexStringToColor(hexString: "#E2E2E2")
        self.normalDateLabel.textColor = UIColor.hexStringToColor(hexString: "#ADADAD")
        
        self.selectDateLabel.textColor = UIColor.hexStringToColor(hexString: "#FFFFFF")
        

    }
    
    
    var day:Day? {
        
        didSet {
            
            if let str = day?.date {
                
                let date = Date.date(str, "yyyy-MM-dd")
                let dd = date?.string("dd")
                
                self.selectDateLabel.text = dd
                self.normalDateLabel.text = dd
            }
            
        }
    }

}
